// TOWN SCRIPT
//    Town 2: Timoria

// This is the special encounter script for this town.
// The states INIT_STATE, EXIT_STATE, and START_STATE have
// meanings that are described in the documenation. States you write
// yourself should be numbered from 10-100.

begintownscript;

variables;

int i,j,k;

body;

beginstate INIT_STATE;
	set_crime_tolerance(1);
	
	set_name(6,"Faustulus");
	set_char_dialogue_pic(6,1957,0);
	set_name(10,"Fasa");
	set_char_dialogue_pic(10,1908,0);
	set_name(11,"Scaevola");
	set_char_dialogue_pic(11,1954,0);
	
	if (get_flag(2,2) != 0)
		erase_char(10);
break;

beginstate EXIT_STATE;
// Always called when the town is left.
break;

beginstate START_STATE;
	if ((get_crime_level() > 0) && (get_flag(250,3) == 0)) {
		set_flag(250,3,1);
		message_dialog("You feel a chill come over you. The gods have seen your crimes, and they will certainly punish you. The only questions are when and how.","");
		}
		
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(6,"What shall we do?");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(6,"It's hopeless!");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(10,"We are not safe.");
	if (get_ran(1,0,100) < 6)
		text_bubble_on_char(11,"Fear is all around.");
break;

beginstate 10;
if (get_flag(2,0) == 0) {
	set_flag(2,0,1);
	message_dialog("You enter a town meeting hall, large but empty and unused. The walls are broken and dusty, and the rostrum at the front has a large fissure down the middle.","_Thank the gods, you've come!_ the graying man at the table says, more than a little on edge. _Please, we have much to discuss._ He nervously rubs his hands together, leaning forward and then pulling up straight, eyes focused and then unfocused.");
	}
break;